package com.cskaoyan.com.collection.collection;

import com.cskaoyan.com.mylist.MyArrayList;

import java.util.Iterator;

public class DemoFor2 {
    public static void main(String[] args) {


        //
        MyArrayList<String> stringMyArrayList = new MyArrayList<>();

        Iterator iterator = stringMyArrayList.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }

        // 编译角度没有通过
        for (String str : stringMyArrayList ){
            System.out.println(str);
        }



    }
}
